package com.weixin.paleituo.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.weixin.paleituo.R;
import com.weixin.paleituo.base.BaseRecycleAdapter;
import com.weixin.paleituo.bean.GetUpBuyHouseBean;
import com.weixin.paleituo.help.RecycleViewHolder;
import com.weixin.paleituo.help.RecycleViewOnItemOnclickListener;

import java.util.List;

/**
 * Author yichao
 * Time  2018/1/15 14:43
 * Dest 放弃购房
 */

public class GetUpBuyHouseListAdapter extends BaseRecycleAdapter<GetUpBuyHouseBean> {
    private RecycleViewOnItemOnclickListener mListener;
    private TextView mTvPosition;
    private TextView mTvTime;
    private ImageView mIvIcon;
    private TextView mTvHouseName;
    private ImageView mIvStep;
    private TextView mTvStep;
    private LinearLayout mLlStepTypeRoot;

    public GetUpBuyHouseListAdapter(Context context, List<GetUpBuyHouseBean> datas) {
        super(context, datas, R.layout.item_buyhouselist_layout);
    }

    @Override
    protected void setData(final RecycleViewHolder holder, final GetUpBuyHouseBean buyHuseBean, final int position) {
        mTvPosition = holder.getItemView(R.id.tv_position_item_buyhouselist_layout);
        mTvTime = holder.getItemView(R.id.tv_time_item_buyhouselist_layout);
        mIvIcon = holder.getItemView(R.id.iv_item_buyhouselist_layout);
        mTvHouseName = holder.getItemView(R.id.tv_house_name_item_buyhouselist_layout);
        mIvStep = holder.getItemView(R.id.iv_step_item_buyhouselist_layout);
        mTvStep = holder.getItemView(R.id.tv_setp_item_buyhouselist_layout);
        mLlStepTypeRoot = holder.getItemView(R.id.ll_steptype_item_buyhouselist_layout);
        mLlStepTypeRoot.setVisibility(View.INVISIBLE);

        /*5-退款、1-预定、2-签约、3-收房、4-入住）*/

        mTvTime.setText(buyHuseBean.getGiveupTime() + "");
        mTvPosition.setText(buyHuseBean.getFullname() + "");
        mTvHouseName.setText(buyHuseBean.getHouse() + "");
        Glide.with(mContext).load(buyHuseBean.getUrl() + "").into(mIvIcon);


    }


}
